<template>
	<view class="main">
		<tou_hand1 handtitle='修改用户信息'></tou_hand1>
		<view class="show">
			<view class="sone">
				<view class="sonetap">
					<view class="soneleft">姓名：</view>
					<input placeholder="请输入姓名" v-model="realName"/>
				</view>
				<view class="sonetap1">
					<view class="soneleft">手机号码：</view>
					<input placeholder="请输入手机号码" v-model="phone"/>
				</view>
				
			</view>
			<view class="stwo" @click="upbtn">
				确认修改
			</view>
		</view>
	</view>
</template>

<script>
	import tou_hand1 from '../../components/tou_hand1/tou_hand1.vue'
	
	export default {
		components: {tou_hand1},
		mounted() {
			
		},

		data() {
			return {
				phone:'',//手机号
				realName:'',//姓名
				id:'',//用户ID
			}
		},
		onLoad(options) {
			if(options.phone!='null'){
				this.phone=options.phone
			}
			this.realName=options.realName
			this.id=options.id
		},
		methods: {
			upbtn(){
				let data={
					realName:this.realName,
					phone:this.phone
				}
				this.$base.request1('manager/user' + '/' + this.id, 'PUT',data)
					.then(res => {
						if(res.data.code==200){
							this.$toast.success('修改成功')
							uni.navigateBack()
						}else{
							this.$toast.fail(res.data.msg)
						}
					})
					.catch(err => {
				
					})
			}
		}
	}
</script>

<style lang="scss" scoped>
	.main {
		width: 100%;
		overflow-x: hidden;

		.show{
			width: 100%;
			box-sizing: border-box;
			.sone{
				width: 686upx;
				border-radius: 16upx;
				box-shadow: -1upx 5upx 9upx 0upx rgba(22,22,22,0.2); 
				margin: 26upx auto;
				box-sizing: border-box;
				padding: 18upx;
				.sonetap{
					width:100%;
					display: flex;
					border-bottom: 1upx solid #e2e2e2;
					box-sizing: border-box;
					padding: 33upx 15upx;
					align-items: center;
					.soneleft{
						font-size: 28upx;
						font-family: PingFang SC Medium, PingFang SC Medium-Medium;
						font-weight: 500;
						color: #666666;
						width: 35%;
					}
					input{
						font-size: 28upx;
						font-family: PingFang SC Medium, PingFang SC Medium-Medium;
						font-weight: 500;
						color: #666666;
					}
				}
				.sonetap1{
					width:100%;
					display: flex;
					box-sizing: border-box;
					padding: 33upx 15upx;
					align-items: center;
					.soneleft{
						font-size: 28upx;
						font-family: PingFang SC Medium, PingFang SC Medium-Medium;
						font-weight: 500;
						color: #666666;
						width: 35%;
					}
					input{
						font-size: 28upx;
						font-family: PingFang SC Medium, PingFang SC Medium-Medium;
						font-weight: 500;
						color: #666666;
					}
				}
			}
			.stwo{
				width: 686upx;
				height: 88upx;
				border-radius: 8upx;
				margin: 0 auto;
				background-color: #4B98ED;
				font-size: 32upx;
				font-family: PingFang SC Bold, PingFang SC Bold-Bold;
				font-weight: 700;
				text-align: center;
				line-height: 88upx;
				color: #ffffff;
				margin-top: 170upx;
			}
		}
		
	}
</style>
